package HomeElements;

import android.support.test.uiautomator.By;
import android.support.test.uiautomator.BySelector;
import android.support.test.uiautomator.UiSelector;

/**
 * Created by zhe.xiao on 2017/6/23.
 */

public class AssertBySelectorElementType {

    /**
     * wifi签证验证点
     */
    public static BySelector wifiInfo(){
        return By.descStartsWith("热门签证");
    }

    /**
     * 出境游验证点
     */
    public static BySelector chuJingInfo(){
        return By.descStartsWith("出境服务");
    }

    /**
     * 接送机验证点
     */
    public static BySelector jieJiSongInfo(){
        return By.descContains("超级巴士");
    }

    /**
     * 一日游验证点
     */
    public static BySelector yiRiYouInfo(){
        BySelector by = By.descContains(" 必游景点推荐");
        return by;
    }

    /**
     * 智慧旅行验证点
     */
    public static BySelector zhiHuiLvYouInfo(){
        return By.desc("智慧玩法");
    }

    /**
     * 定制游验证点
     */
    public static BySelector dingZhiYouInfo(){
        return By.desc("私人定制");
    }

    /**
     * 特色住验证点
     */
    public static UiSelector teSeZhuInfo(){
//        return By.text("客栈名/地名");
        return new UiSelector().text("客栈名/地名");
    }

    /**
     * 领券中心验证点
     */
    public static BySelector lingQuanZhongXinInfo(){
        return By.desc("优惠中心");
    }

    /**
     * 踏青赏花验证点
     */
    public static BySelector taQingShangHuaInfo(){
        return By.desc("赏花踏青采摘");
    }

    /**
     * 特价游验证点
     */
    public static BySelector teJiaYouInfo(){
        return By.desc("天天特价");
    }

    /**
     * 您可能想去tag标签
     */
    public static BySelector ninTag1Info(){
        BySelector by = By.clazz("android.widget.RadioGroup").depth(11,13).res("com.mqunar.atom.alexhome:id/atom_alexhome_poi_container");
        return by;
    }

    /**
     * 您可能想去跳转后tag标签
     */
    public static BySelector ninTag1TiaoInfo(){
        BySelector by = By.clazz("android.widget.ListView").depth(10, 11);
        return by;
    }

    /**
     * 最近关注全部按钮验证
     */
    public static BySelector zuiJinGuanZhuInfo(){
        BySelector by = By.desc("全部关注");
        return by;
    }

    /**
     * 最近关注酒店验证
     */
    public static BySelector zuiJinGuanZhuHotelInfo(){
        BySelector by = By.res("com.mqunar.atom.hotel:id/atom_hotel_tx_title");
        return by;
    }

    /**
     * 最近关注门票验证
     */
    public static BySelector zuiJinGuanZhuTicketInfo(){
        BySelector by = By.clazz("android.view.View");
        return by;
    }

    /**
     * 最近关注度假
     */
    public static BySelector zuiJinGuanZhuVInfo(){
        BySelector by = By.clazz("android.webkit.WebView");
        return by;
    }

    /**
     * 最近关注验证信息
     */
    public static BySelector zuiJinGuanZhuYanInfo(){
        BySelector by = By.res("com.mqunar.atom.alexhome:id/atom_alexhome_recent_card_products");
        return by;
    }

    /**
     * 热门专题验证
     */
    public static BySelector renMenMoreInfo(){
        BySelector by = By.descStartsWith("专题");
        return by;
    }

    /**
     * 热门专题tag跳转验证
     */
    public static BySelector renMenZhuanTagInfo(){
        BySelector by = By.clazz("android.view.View").depth(8, 10);
        return by;
    }

    /**
     * 热门目的地验证
     */
    public static BySelector renMenMuMoreInfo(){
        BySelector by = By.descStartsWith("地区");
        return by;
    }

    /**
     * 热门目的地城市验证
     */
    public static UiSelector reMenMuCityInfo(){
        UiSelector by = new UiSelector().className("android.view.View");
        return by;
    }

    /**
     * 热门专题城市
     */
    public static BySelector reMenMuCity(){
        BySelector by = By.textStartsWith("热门目的地");
        return by;
    }

    /**
     * 6+1 第一个
     */
    public static BySelector guangGao1Info(){
        BySelector by = By.desc("特价推荐");
        return by;
    }

    /**
     * 6+1 通用
     */
    public static BySelector guangGaoTInfo(){
        BySelector by = By.desc("首页");
        return by;
    }

    /**
     * 验证push标题是否出现异常
     */
    public static BySelector pushInfo(){
        BySelector by = By.res("com.mqunar.hy:id/atom_browser_txTitle");
        return by;
    }

    /**
     * 验证banner网络异常
     */
    public static BySelector bannerInternetInfo(){
        BySelector by = By.res("com.mqunar.framework:id/pub_fw_tv_net_fail");
        return by;
    }
}
